// 统一管理医院详情模块接口
import requset from "@/utils/request";
// 引入ts类型
import { HospitalDetailResponseDate, DepartmentResponseData, UserLoginResponseData, LoginData, WXLoginResponseData, HospitalWorkResponseData, DoctorResponseData, VisitorResponseData, DoctorInfoData } from './type'
// 枚举
enum API{
    // 获取医院详情数据
    HOSPITALDETAIL_URL = '/hosp/hospital/',
    // 获取医院科室的数据
    HOSPITALDEPARTMENT_URL = '/hosp/hospital/department/',
    // 获取用户验证码
    GETUSERCODE_URL = '/sms/send/',
    //用户登录接口
    USERLOGIN_URL = '/user/login',
    // 获取微信扫码登录所要参数
    WXLOGIN_URL = '/user/weixin/getLoginParam/',
    // 获取可预约排班数据
    HOSPITALWORD_URL = '/hosp/hospital/auth/getBookingScheduleRule/',
    // 获取值班医生的数据
    HOSPITALDOCTOR_URL = '/hosp/hospital/auth/findScheduleList/',
    // 获取就诊人信息
    GETVISITOR_URL = '/user/patient/auth/findAll',
    // 获取挂号医生的信息
    GETDOCTORINFO_URL = '/hosp/hospital/getSchedule/'
}

// 获取医院详情数据
export const reqHospitalDetail = (hoscode: string) => requset.get<any, HospitalDetailResponseDate>(API.HOSPITALDETAIL_URL + hoscode)
// 获取医院科室的数据
export const reqHospitalDeparment = (hoscode: string) => requset.get<any, DepartmentResponseData>(API.HOSPITALDEPARTMENT_URL + hoscode)
// 获取用户验证码
export const reqCode = (phone:string) => requset.get<any,any>(API.GETUSERCODE_URL + phone);
//用户登录接口
export const reqUserLogin = (data: LoginData) => requset.post<any, UserLoginResponseData>(API.USERLOGIN_URL, data);
// 获取微信扫码登录所要参数接口
export const reqWXLogin = (wxRedirectUri: string) => requset.get<any, WXLoginResponseData>(API.WXLOGIN_URL +`?wxRedirectUri=${wxRedirectUri}`)
// 获取可预约排班数据接口
export const reqHospitalWork = (page: number, limit: number, hoscode: string, depcode: string) => requset.get<any, HospitalWorkResponseData>(API.HOSPITALWORD_URL+`${page}/${limit}/${hoscode}/${depcode}`)
// 获取值班医生的数据的接口
export const reqHospitalDoctor = (hoscode: string, depcode: string, workDate: string) => requset.get<any, DoctorResponseData>(API.HOSPITALDOCTOR_URL + `${hoscode}/${depcode}/${workDate}`)
// 获取就诊人信息的接口
export const reqVisitor = () => requset.get<any, VisitorResponseData>(API.GETVISITOR_URL)
// 获取挂号医生的信息的接口
export const reqDoctorInfo = (scheduleId:string) => requset.get<any, DoctorInfoData>(API.GETDOCTORINFO_URL + scheduleId)